package so.sao.shop.supplier.web.app;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import so.sao.shop.supplier.pojo.Result;
import so.sao.shop.supplier.pojo.input.AppApplyForServiceInput;
import so.sao.shop.supplier.pojo.input.ServiceLogisticsInput;
import so.sao.shop.supplier.service.app.AppApplyForServiceService;

/**
 *<p>Version: </p>
 *<p>Title: AppApplyForServiceController</p>
 *<p>Description:app申请售后所有接口 </p>
 *@author: hanchao
 *@Date: Created in 2017/11/27 11:46
 */
@RestController
@RequestMapping("/applyForService")
public class AppApplyForServiceController {

    @Autowired
    private AppApplyForServiceService appApplyForServiceService;

    /**
     * 根据detailsId查询退货退款/换货详情
     * @param detailsId
     * @return Result
     */
    @GetMapping(value = "/searchApplicationDetail")
    public Result searchApplicationDetail(@RequestParam("detailsId") Long detailsId) {
        return appApplyForServiceService.searchApplicationDetail(detailsId);
    }
    /**
     * 退货退款/换货申请售后
     * @param appApplyForServiceInput
     * @return
     */
    @PostMapping(value = "/insertApplicationContent")
    public Result insertApplicationContent( @RequestBody AppApplyForServiceInput appApplyForServiceInput ){
        return appApplyForServiceService.updateDetailsItemInformation( appApplyForServiceInput );
    }

    /**
     *拒收/退换货新增售后物流信息
     * @param serviceLogisticsInput
     * @return Result
     */
    @PostMapping(value = "/insertLogisticsInformation")
    public Result insertLogisticsInformation(@RequestBody ServiceLogisticsInput serviceLogisticsInput ){
        return  appApplyForServiceService.insertLogisticsInformation( serviceLogisticsInput );
    }

    /**
     * 根据detailsId查询门店退换货物流信息
     * @param detailsId
     * @return Result
     */
    @GetMapping(value = "/searchLogisticsInformation")
    public Result searchLogisticsInformation(@RequestParam("detailsId") Long detailsId) {
        return appApplyForServiceService.searchLogisticsInformation(detailsId);
    }


}
